Improving Prolog Programs: Refactoring for Prolog

نویسندگان

  • Tom Schrijvers
  • Alexander Serebrenik
چکیده

Refactoring is an established technique from the object-oriented (OO) programming community to restructure code: it aims at improving software readability, maintainability and extensibility. Although refactoring is not tied to the OO-paradigm in particular, its ideas have not been applied to Logic Programming until now. This paper applies the ideas of refactoring to Prolog programs. A catalogue is presented listing refactorings classified according to scope. Some of the refactorings have been adapted from the OO-paradigm, while others have been specifically designed for Prolog. The discrepancy between intended and operational semantics in Prolog is also addressed by some of the refactorings. In addition, ViPReSS, a semi-automatic refactoring browser, is discussed and the experience with applying ViPReSS to a large Prolog legacy system is reported. The main conclusion is that refactoring is both a viable technique in Prolog and a rather desirable one.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Refactoring Prolog Code

Refactoring is a popular technique from the OO-community to restructure code: it aims at improving software readability, maintainability and extensibility. In this paper we apply the ideas of refactoring to Prolog programs. We present a catalogue of refactorings adapted to or specificly developed for Prolog. We also discuss ViPReSS, our semi-automatic refactoring browser, and our experience wit...

متن کامل

Refactoring Prolog programs

Refactoring is a technique to restructure code in a disciplined way originating from the OO-community. It aims to improve software readability, maintainability and extensibility. Unlike the existing results on program transformation refactoring can require user input to take certain decisions. In this paper we apply the ideas of refactoring to Prolog programs. We start by presenting a catalogue...

متن کامل

Porting and refactoring Prolog programs: the PROSYN case study

Operational software systems need to be maintained. Prolog has strengths and weaknesses if it comes to software maintenance. Its reflexive capabilities and the fact that Prolog programs can be represented naturally as Prolog data are strengths when it comes to porting and refactoring. On the other side, its dynamic and untyped nature limit the possibilities for static analysis and safe refactor...

متن کامل

Comprehending and Visualising Software based on XML–Representations and Call Graphs

We have implemented a PROLOG–tool VISUR/RAR for reasoning about various types of source code, such as PROLOG–rules or JAVA–programs. RAR provides retrieval and update operations for a deductive database storing XML–representations of the investigated code. The obtained results are visualised using graphs or tables in VISUR. The deductive database contains rules for analysing PROLOG–code based o...

متن کامل

Uniication-free Execution of Well-moded and Well-typed Prolog Programs 1

In this paper, a static analysis of Prolog programs has been proposed to improve the eeciency by replacing run-time uniication with matching. Programs for which run-time uniication can be replaced by matching are called uniication-free programs. We propose a set of suucient conditions for uniication-freedom improving the existing results and discuss the application of our results in improving W...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • TPLP

دوره 8  شماره 

صفحات  -

تاریخ انتشار 2004